﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using Mbl.ParameterizedTest.AcceptanceTests.CalculatorTests;

namespace Mbl.ParameterizedTest.AcceptanceTests.ExceptionTests
{
    [TestClass]
    public class ExceptionExpectationTests
    {
        [TestMethod]
        [ExpectedFailedTestCases(2, 3)]
        public void ExpectedException_tests()
        {            
            ParameterizedTest
                .For((Func<string, string> ) (s => { throw new InvalidOperationException("Oups"); }))
                .Given("asdf").ExpectException<InvalidOperationException>().Because("It's right")
                .Given("asdf").ExpectException<IndexOutOfRangeException>().Because("It's wrong")
                .Given("asdf").ExpectException<Exception>().Because("It's wrong")
                .Evaluate();
        }        
    }
}
